package com.lmc.forum.controller;

import com.lmc.forum.common.AppResult;
import com.lmc.forum.common.ResultCode;
import com.lmc.forum.exception.ApplicationException;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@RequestMapping("/test")
@RestController
public class TestController {

    @RequestMapping("/hello")
    public String hello() {
        return "Hello, Spring Boot...";
    }

    @RequestMapping("/testApplicationException")
    public String testApplicationException() {
        throw new ApplicationException("这是一个自定义错误");
    }

    @RequestMapping("/testException")
    public String testException() throws Exception{
        throw new Exception("这是一个exception错误");
    }


}
